import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import UserView from '../views/UserView.vue'
import Login from '../views/login.vue'
import OutView from '../views/OutView.vue'
import Staging from '../views/Staging_my.vue'
import MyStaging from '../views/MyStaging.vue'
import mywork from '../views/mywork.vue'
import NewWork from '../views/NewWork.vue'
import Write from '../views/Write.vue'
import setPassword from '../views/setPassword.vue'
import RegisterView from '../views/RegisterView.vue'
import forgotpass from '../views/forgotpass.vue'
import WorkSetting from '../views/WorkSetting.vue'
import ContractSettings from '../views/ContractSettings.vue'
import SearchView from '../views/SearchResults.vue'
import WorkProfile from '../views/WorkProfile.vue'
import WorkView from '../views/WorkView.vue'
import AgreementView from '../views/AgreementView.vue'

import Market from '../views/Market.vue'; // 导入剧本集市页面
import Solicit from '../views/Solicit.vue'
import UserAgreement from '../views/UserAgreement.vue'
import PrivacyClause from '../views/PrivacyClause.vue'
import AgreementDeal from '../views/AgreementDeal.vue'
import UserSetAgreement from '../views/UserSetAgreement.vue'
import SolicitDetail from '@/views/Solicit-detail.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/user/:uid',
      name: 'User',
      component: UserView
    },
    {
      path: '/out',
      name: 'Out',
      component: OutView
    },
    {
      path: '/staging',
      name: 'Staging',
      component: Staging,
      children: [
        {
          path: 'mystaging',
          name: 'MyStaging',
          component: MyStaging
        },
        {
          path: 'mywork',
          name: 'mywork',
          component: mywork
        },
        {
          path: 'newwork',
          name: 'NewWork',
          component: NewWork
        },
        {
          path:'setPassword',
          name:'setPassword',
          component:setPassword
        },
        {
          path:'forgotpass',
          name:'forgotpass',
          component:forgotpass
        },
        {
          path:'worksetting/:id',
          name:'WorkSetting',
          component:WorkSetting
        },
        {
          path:'contractsetting/:id',
          name:'ContractSettings',
          component:ContractSettings
        }
      ]
    },
    {
      path: '/write/:id',
      name: 'Write',
      component: Write
    },
    {
      path: '/register',
      name: 'Register',
      component: RegisterView
    },
    {
      path: '/SearchResults',
      name: 'SearchResults',
      component: SearchView,
      props: true, // 启用路由参数作为 props 传递给组件
    },
    {
      path: '/workprofile/:id',
      name: 'WorkProfile',
      component: WorkProfile,
      props: true
    },
    {
      path: '/workview/:id',
      name: 'WorkView',
      component: WorkView,
      props: true
    },
    {
      path: '/solicit-detail/:id', // 页面路径
      name: 'SolicitDetail',
      component: SolicitDetail,
    },
    {
      path: '/agreementview',
      name: 'AgreementView',    
      component: AgreementView,
      props: true
    },
    {
      path:'/agreementdeal/:uid',
      name:'AgreementDeal',
      component:AgreementDeal,
      props:true
    },
    {
      path: '/market', // 添加剧本集市页面的路由
      name: 'Market',
      component: Market
    },
    {
      path: '/solicit',
      name: 'Solicit',
      component: Solicit
    },
    {
      path: '/useragreement',
      name: 'useragreement',
      component: UserAgreement
    },
    {
      path: '/privacyclause',
      name: 'privacyclause',
      component: PrivacyClause
    },
    {
      path: '/agreementdeal',
      name: 'agreementdeal',
      component: AgreementDeal,
      props: true
    },
    {
      path: '/usersetagreement',
      name: 'usersetagreement',
      component: UserSetAgreement
    }
    

  ]
})

export default router
